/*
 * Copyright (c) 2018. paascloud.net All Rights Reserved.
 * 项目名称：paascloud快速搭建企业级分布式微服务平台
 * 类名称：UacUserTokenFeignApiHystrix.java
 * 创建人：刘兆明
 * 联系方式：paascloud.net@gmail.com
 * 开源地址: https://github.com/paascloud
 * 博客地址: http://blog.paascloud.net
 * 项目官网: http://paascloud.net
 */

package com.choichumgming.rentcat.service.hystrix;


import com.choichumgming.rentcat.common.api.CommonResult;
import com.choichumgming.rentcat.dto.MemberDetails;
import com.choichumgming.rentcat.model.UmsMember;
import com.choichumgming.rentcat.service.UmsMemberFeignApi;
import org.springframework.stereotype.Component;

@Component
public class UmsMemberFeignApiHystrix implements UmsMemberFeignApi {

	@Override
	public CommonResult<UmsMember> getByUserId(Long userId) {
		UmsMember umsMember = new UmsMember();
		umsMember.setUsername("guest");
		umsMember.setPassword("guest");
		umsMember.setDescription("访客");
		return CommonResult.success(umsMember);
	}

	@Override
	public CommonResult<MemberDetails> loadUserByUsername(String username) {
		UmsMember umsMember = new UmsMember();
		umsMember.setUsername("guest");
		umsMember.setPassword("guest");
		umsMember.setDescription("访客");

		MemberDetails memberDetails = new MemberDetails();
		memberDetails.setUmsMember(umsMember);
		return CommonResult.success(memberDetails);
	}
}
